package com.geekaca.news.controller.test;

import com.geekaca.news.domain.News;
import com.geekaca.news.service.NewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class IndexController {
    @Autowired
    private NewsService newsService;


    @RequestMapping("/index")
    public  String index(Model model){
        model.addAttribute("msg","<b>欢迎访问</b>");
        News blog = newsService.getById(6L);
        model.addAttribute("blog",blog);


        return "/thymestudy/index";
    }
}
